<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'post-form',
    'enableAjaxValidation' => true,
    'enableClientValidation' => true,
    'type' => 'horizontal',
    'clientOptions' => array(
        'validateOnSubmit' => true,
    ),
));
?>

<p class="help-block">Fields with <span class="required">*</span> are required.</p>

<?php echo $form->errorSummary($model); ?>

<?php echo $form->textFieldRow($model, 'post_title', array('class' => 'span5', 'maxlength' => 255)); ?>

<?php echo $form->textFieldRow($model, 'alias', array('class' => 'span5', 'maxlength' => 255)); ?>

<?php echo $form->textAreaRow($model, 'post_description', array('rows' => 6, 'cols' => 50, 'class' => 'span8')); ?>

<?php echo $form->textAreaRow($model, 'post_content', array('rows' => 6, 'cols' => 50, 'class' => 'span8')); ?>


<ul class="nav nav-tabs">
    <li class="active"><a data-toggle="tab" href="#images-tab">Images</a></li>
    <li>
        <a data-toggle="tab" href="#meta-tab">Meta data</a>
    </li>
    <li>
        <a data-toggle="tab" href="#publish-tab">Publish</a>
    </li>
</ul>
<div class="tab-content">
    <div id="images-tab" class="tab-pane active">

        <?php echo $form->textAreaRow($model, 'images', array('rows' => 6, 'cols' => 50, 'class' => 'span8')); ?>

    </div>

    <div id="meta-tab" class="tab-pane fade">
        <?php echo $form->textAreaRow($model, 'tags', array('class' => 'span8')); ?>

        <?php echo $form->textAreaRow($model, 'meta_keywords', array('class' => 'span8', 'maxlength' => 255)); ?>

        <?php echo $form->textAreaRow($model, 'meta_description', array('class' => 'span8', 'maxlength' => 255)); ?>
    </div>

    <div id="publish-tab" class="tab-pane fade">

        <?php echo $form->textFieldRow($model, 'parent_id', array('class' => 'span5')); ?>
        <?php echo $form->dropDownListRow($model, 'status', array(
            Post::STATUS_PUBLISH => 'Publish',
            Post::STATUS_DRAFT => 'Draft',
            Post::STATUS_ARCHIVE => 'Archive'
        ), array('class' => 'span5')); ?>
        <?php echo $form->textFieldRow($model, 'sticky', array('class' => 'span5')); ?>
    </div>
</div>

<div class="form-actions">
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'buttonType' => 'submit',
        'type' => 'primary',
        'label' => $model->isNewRecord ? 'Create' : 'Save',
    ));
    ?>
</div>

<?php $this->endWidget(); ?>
